/*
 * Copyright (c) 2025, 大连理工大学 (Dalian University of Technology)
 *
 * Licensed under the Mulan PSL v2.
 * You can use this file according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of the License at
 *
 *     http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. SEE THE MULAN PSL v2
 * FOR MORE DETAILS.
 */

#pragma once

#include "highfive/H5File.hpp"

#include "DBManager/IRepository/Input/Load/IRLOAD1Repository.h"
#include "DBManager/Repository/HDF5/Base/SingleSetRepositoryBase.h"

template <>
inline HighFive::DataType HighFive::create_datatype<SG::DataStructure::FEM::RLOAD1Data> ()
{
    HighFive::CompoundType compoundType = { { "SID", HighFive::create_datatype<SG::DataStructure::Common::Id> () },
                                            { "DAREA", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "DELAY", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "DPHASE", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "TC", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "TD", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "TYPE", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "T", HighFive::create_datatype<SG::DataStructure::Common::Real> () },
                                            { "PH", HighFive::create_datatype<SG::DataStructure::Common::Real> () },
                                            { "RC", HighFive::create_datatype<SG::DataStructure::Common::Real> () },
                                            { "RD", HighFive::create_datatype<SG::DataStructure::Common::Real> () },
                                            { "DOMAIN_ID", HighFive::create_datatype<SG::DataStructure::Common::Id> () } };
    return compoundType;
}
SG_DBMANAGER_HDF5_NAMESPACE_OPEN
class RLOAD1Repository : public IRLOAD1Repository, public SingleSetRepositoryBase<SG::DataStructure::FEM::RLOAD1Data>
{
  public:
    explicit RLOAD1Repository (HDF5Database& database);

    void InitialDatasetInfo () override;
};
SG_DBMANAGER_HDF5_NAMESPACE_CLOSE
